#!/bin/bash
cd $WORKSPACE/docker/prod
appVersion="$(cat prod-app.env | grep version= | cut -d '=' -f2)"
echo "read appVersion !version=$appVersion!"
export appVersion=$appVersion
docker compose  -f docker-compose-build-pf-app.yml build
./login-docker.sh

/usr/bin/docker push registry.cn-beijing.aliyuncs.com/dragon_plan_prod/dragon_plan:app_sxkj_prod_${appVersion}

if [ "$appVersion"x == "v1"x ]
then
  appVersion="v2"
else
  appVersion="v1"
fi
echo "write appVersion !version=$appVersion!"
echo "version=$appVersion" > prod-app.env
